﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace T4.Test
{
	internal static class StringExtention
	{
		static readonly Regex EndlineRegex = new Regex(@"[\r\n\t]+", RegexOptions.Compiled); 
		static readonly Regex WhitespacesRegex = new Regex(@"[ ]{2,}", RegexOptions.Compiled);

		internal static string RemoveSpecialCharacters(this string str)
		{
			str = EndlineRegex.Replace(str, " ");
			return WhitespacesRegex.Replace(str, " ").Trim();
		}
	}
}
